home *** CD-ROM | disk | FTP | other *** search
-
- Free Information Xchange presents:
-
- Quake II v3.14 - CD crack by Static Vengeance - May 5th, 1999
-
- REQUIREMENTS:
- Full game install
- W32Dasm & Hex editor
-
- Alright now, before you go and say its old... before you tell me that the latest patches eliminated
- the CD check anyways. I'm writing this tut for one reason. I'll try to show you how you can "trick" a copy
- protection routine into passing. Plus, it seems most people have a copy of Quake II to work with :p
- First, you'll need to know a few things about the routine. Some things to know are: What if any value
- is returned for pass or fail. Are there any memory flag values set, like to check if the routine had actually
- been run or store returned or read values in memory. Well this routine has a some of those things and I'll
- show you a clever way (IMHO) to bypass them all. So let's begin with our little adventure in cracking and see
- where we end up:
- After installing and trying to run the game you'll see a standard windows pop-up dialog box asking
- or telling you that you need the Quake2 CD in the CD rom drive to play. So disassemble the quake2.exe program
- with W32Dasm. Now go up to the menu bar and select refs and then select "String data references" from the drop
- down menu. From the refs box, grab the slider bar and scroll down to the string "You must have the Quake2 CD
- in " and double click on it. This will put you here:
-
- * Referenced by a CALL at Address:
- |:0042B386 <-- Called only once
- |
- :0042F5F0 E82BFFFFFF call 0042F520 <-- Call the CD check routine
- :0042F5F5 803800 cmp byte ptr [eax], 00 <-- Use returned value as pointer to flag
- :0042F5F8 750F jne 0042F609 <-- Must be non-zero for a passed CD check
-
- * Possible StringData Ref from Data Obj ->"You must have the Quake2 CD in " <-- Nasty pop-up dialog
- ->"the drive to play." <-- That got us here
- |
- :0042F5FA 683CD24400 push 0044D23C
- :0042F5FF 6A00 push 00000000
- :0042F601 E89A41FEFF call 004137A0
- :0042F606 83C408 add esp, 00000008
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0042F5F8(C)
- |
- :0042F609 C3 ret <-- Return to caller
-
- Alright, let's check out the code that checks for the CD. A look at the code starting at
- 42F520 shows what's going on. And it looks like this:
-
- * Referenced by a CALL at Addresses:
- |:0042F5F0 , :0042FC81 <-- Called by two routines
- |
- :0042F520 A1DC224700 mov eax, dword ptr [004722DC] <-- Did we run the CD check yet
- :0042F525 83EC44 sub esp, 00000044
- :0042F528 85C0 test eax, eax <-- Test the flag and see
- :0042F52A 56 push esi
- :0042F52B 740A je 0042F537 <-- Zero means not yet
- :0042F52D B8E0224700 mov eax, 004722E0 <-- Non-zero value / pointer
- :0042F532 5E pop esi
- :0042F533 83C444 add esp, 00000044
- :0042F536 C3 ret <-- Return to caller
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0042F52B(C)
- |
- :0042F537 6A01 push 00000001
-
- * Reference To: KERNEL32.SetErrorMode, Ord:0213h
- |
- :0042F539 FF15C4204400 Call dword ptr [004420C4]
-
- * Reference To: KERNEL32.GetDriveTypeA, Ord:00DFh <-- Commonly used call in CD checks
- |
- :0042F53F 8B35C0204400 mov esi, dword ptr [004420C0]
- :0042F545 C64424053A mov [esp+05], 3A
- :0042F54A C64424065C mov [esp+06], 5C
- :0042F54F C644240700 mov [esp+07], 00
- :0042F554 C705DC22470001000000 mov dword ptr [004722DC], 00000001 <-- Was the CD check run flag
- :0042F55E C644240463 mov [esp+04], 63 <-- Start with C:\ drive
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0042F5C8(C)
- |
- :0042F563 8D442404 lea eax, dword ptr [esp+04] <-- Current drive to check on
- :0042F567 50 push eax
-
- * Possible StringData Ref from Data Obj ->"%sinstall\data"
- |
- :0042F568 682CD24400 push 0044D22C
- :0042F56D 68E0224700 push 004722E0
- :0042F572 E8692D0000 call 004322E0
- :0042F577 83C40C add esp, 0000000C
- :0042F57A 8D4C2404 lea ecx, dword ptr [esp+04]
- :0042F57E 8D542408 lea edx, dword ptr [esp+08]
- :0042F582 51 push ecx
-
- * Possible StringData Ref from Data Obj ->"%sinstall\data\quake2.exe" <-- File to check for on the CD
- |
- :0042F583 6810D24400 push 0044D210
- :0042F588 52 push edx
- :0042F589 E8522D0000 call 004322E0
- :0042F58E 83C40C add esp, 0000000C
- :0042F591 8D442408 lea eax, dword ptr [esp+08]
-
- * Possible StringData Ref from Data Obj ->"r" <-- Read the file
- |
- :0042F595 680CD24400 push 0044D20C
- :0042F59A 50 push eax
- :0042F59B E8002A0000 call 00431FA0
- :0042F5A0 83C408 add esp, 00000008
- :0042F5A3 85C0 test eax, eax
- :0042F5A5 7415 je 0042F5BC
- :0042F5A7 50 push eax
- :0042F5A8 E813240000 call 004319C0
- :0042F5AD 83C404 add esp, 00000004
- :0042F5B0 8D4C2404 lea ecx, dword ptr [esp+04]
- :0042F5B4 51 push ecx
- :0042F5B5 FFD6 call esi <-- Make the getdrivetypea call
- :0042F5B7 83F805 cmp eax, 00000005 <-- 05 is code for CD Rom drive
- :0042F5BA 741C je 0042F5D8 <-- Exit to "good" check section of code
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0042F5A5(C)
- |
- :0042F5BC 8A442404 mov al, byte ptr [esp+04] <-- Current drive to check on
- :0042F5C0 FEC0 inc al <-- Let's try the next one
- :0042F5C2 3C7A cmp al, 7A <-- Stop after drive Z:\
- :0042F5C4 88442404 mov byte ptr [esp+04], al <-- Store it back
- :0042F5C8 7E99 jle 0042F563 <-- Less then Z go back up and try again
- :0042F5CA C605E022470000 mov byte ptr [004722E0], 00 <-- Set up for failed CD read
- :0042F5D1 33C0 xor eax, eax <-- return failed read value in eax
- :0042F5D3 5E pop esi
- :0042F5D4 83C444 add esp, 00000044
- :0042F5D7 C3 ret <-- Return to caller
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0042F5BA(C)
- |
- :0042F5D8 B8E0224700 mov eax, 004722E0 <-- Used as pointer to pass/fail flag
- :0042F5DD 5E pop esi
- :0042F5DE 83C444 add esp, 00000044
- :0042F5E1 C3 ret <-- Return to caller
-
- A quick description of what's going on with the above. First the CD check routine will check
- if the code that checks for the CD has been run. A non-zero value stored at 4722DC means the CD
- check has been run. If it hasn't been run, the code branches down to the routine that actualy checks
- for the quake2.exe file on the CD. The first thing that routine does is set up variables and stores
- a 01 in the CD check was run flag. This way the CD check will only be run one time through. Then
- the code will start with drive C:\ and check for quake2.exe in the directory install\data\. Once found
- it checks the drive it found the file on to see if it's a CD Rom drive. If it is, then the code jumps
- down to the pass section of the routine. If not, it'll increment the drive letter and jump back up to
- start checking for the quake2.exe all over. Finally, if all possible drives have been checked and
- the CD has not been found a zero 4722E0 for a failed CD check. However, if all things went well (in
- the eyes of copy protection) eax is loaded with 004722E0, which is the memory location of the CD check
- pass/fail flag. Then the code that called the CD check will use this value as a pointer and check the
- value stored there. If 4722E0 holds a zero then up pops a standard windows dialog box telling you, you
- will need the Quake 2 CD in the drive to play the game.
- After looking at this code, I decided I would reroute the code and force it into setting up
- the proper flags then jump to the "passed CD check" section. To do that we need to run the code up
- through 42F55E, then get down to 42F5CA. Once there, change the code to store a 01 instead of the 00
- it does now. Now take the xor eax, eax and change that to a jmp 42F5D8. Now all conditions are met,
- the flag for "did the CD check run?" is set then the code stores a non-zero value in the actual CD
- check pass/fail at 4722E0. And finally the CD check exits through "passed CD check" portion of the
- code. This will all work by making "two" changes to code. At 42F563, change the lea eax, dword ptr
- [esp+04] and the push eax to jmp 42F5CA by changing the hex from 8D 44 24 04 50 to E9 62 00 00 00.
- Then for the second edit, for forcing a non-zero value in the CD checking flag and the code redirect
- to the pass section, change the hex bytes 00 33 C0 to 01 EB 05 at 42F5D0. To let you see what the
- computer would run, it would look something like this (in process):
-
- :0042F537 6A01 push 00000001
-
- * Reference To: KERNEL32.SetErrorMode, Ord:0213h
- |
- :0042F539 FF15C4204400 Call dword ptr [004420C4]
-
- * Reference To: KERNEL32.GetDriveTypeA, Ord:00DFh <-- Commonly used call in CD checks
- |
- :0042F53F 8B35C0204400 mov esi, dword ptr [004420C0]
- :0042F545 C64424053A mov [esp+05], 3A
- :0042F54A C64424065C mov [esp+06], 5C
- :0042F54F C644240700 mov [esp+07], 00
- :0042F554 C705DC22470001000000 mov dword ptr [004722DC], 00000001 <-- Was the CD check run flag
- :0042F55E C644240463 mov [esp+04], 63 <-- Start with C:\ drive
- :0042F563 E962000000 jmp 0047F5CA <-- Jump down to force it code
-
- :0042F5CA C605E022470001 mov byte ptr [004722E0], 01 <-- Force value for a passed CD read
- :0042F5D1 EB05 jmp 0042F5D8 <-- Jump to passed CD check & exit code
-
- :0042F5D8 B8E0224700 mov eax, 004722E0 <-- Used as pointer to pass/fail flag
- :0042F5DD 5E pop esi
- :0042F5DE 83C444 add esp, 00000044
- :0042F5E1 C3 ret <-- Return to caller
-
- These modifications will force all conditions of the CD check to pass reguardless of who calls
- the check or how many times it's called even when no CD is present. Like I said the latest versions of
- Quake II patches eliminate the CD check routines - hhmmmm, wonder why that is? Still there is/was a need
- to show a tutorial on how it can be cracked. This tutorial showed you how you can alter CD checks into
- setting the correct flags and returning the correct values. Other tutorials I have done on rerouting code
- and or forcing the flags would be VR Powerboat Racing and Hardcore 4x4 Racing. Read 'em if you need 'em.
- Until the next tutorial, good luck in your cracking efforts!
-
- 1. Do a full install of the game
- 2. Make the following edits:
-
- Edit quake2.exe
- ==============================
- Search for: 8D 44 24 04 50 at
- Change to : E9 62 00 00 00
-
- Search for: 00 33 C0
- Change to : 01 EB 05
-
- 3. Enjoy the game! -- and frag somebodys ass!
- 4. Download and install the latest v3.20 patches
- 5. If you have a CPU with the 3DNow! instruction set, get the 3DNow! accelerated patch
-
- Static Vengeance - FiX
-
-